package com.blb.community_admin.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.ArrayList;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("sys_role")
public class SysRole {

  @TableId(type = IdType.AUTO)
  @ExcelProperty("角色ID")
  private long roleId;

  @ExcelProperty("角色名称")
  private String roleName;

  @ExcelProperty("角色权限字符串")
  private String roleKey;

  @ExcelProperty("显示顺序")
  private long roleSort;

  @ExcelProperty("数据范围（1：全部数据权限 2：自定数据权限 3：本部门数据权限")
  private String dataScope;

  @ExcelIgnore
  private long menuCheckStrictly;

  @ExcelIgnore
  private long deptCheckStrictly;

  @ExcelProperty("角色状态（0正常 1停用）")
  private String status;

  @ExcelProperty("删除标志（0代表存在 2代表删除）")
  private String delFlag;

  @ExcelProperty("创建者")
  private String createBy;


  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @ExcelProperty("创建时间")
  private LocalDateTime createTime;

  @ExcelProperty("更新者")
  private String updateBy;


  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @ExcelProperty("更新时间")
  private LocalDateTime updateTime;

  @ExcelProperty("备注")
  private String remark;

  @TableField(exist = false)
  @ExcelIgnore
  private Long[] menuIds;
}
